<?php

include "Twitter.php";


$twitter = new Twitter("hBFWdY3JSgrfCJKjivJw","uemJ3Ml8DoAQyOO0amKUifwzTV7pjcaEK2N3ZKgk");


if($dados = $twitter->api("https://api.twitter.com/1.1/search/tweets.json?q=%23pronto%20-foder%20-cu&lang=pt&rpp=35")){

	$total =  count($dados['statuses']);

	for($a=0; $a<$total; $a++){
		$user = $dados['statuses'][$a]['user']['screen_name'];
		$text = $dados['statuses'][$a]['text'];
		$id = $dados['statuses'][$a]['id_str'];
		$link = "http://www.twitter.com/".$user."/status/".$id;
		$linkpronto = '<a href="https://twitter.com/search?q=%23Pronto" target="_blank">#PRONTO</a>';
		$text = strtolower($text);
		$text = str_ireplace("#pronto", $linkpronto, $text);
		echo '<div class="twit" style="display:block"><a class="user" href="'.$link.'" target="_blank">@'.$user.' </a> '.$text.'</div>';	
	}

}else{

	echo "Api returned false";

}



?>